//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_1232 {
    public demo_1232() {
    }

    public static void main(String[] args) {
        int[][] cordinates = new int[][]{{2, 4}, {2, 5}, {2, 8}};
        System.out.println(checkStraightLine(cordinates));
    }

    public static boolean checkStraightLine(int[][] coordinates) {
        int deltaX = coordinates[0][0];
        int deltaY = coordinates[0][1];
        int n = coordinates.length;

        for(int i = 0; i < n; ++i) {
            coordinates[i][0] -= deltaX;
            coordinates[i][1] -= deltaY;
        }

        int A = coordinates[1][1];
        int B = -coordinates[1][0];

        for(int i = 2; i < n; ++i) {
            int x = coordinates[i][0];
            int y = coordinates[i][1];
            if (A * x + B * y != 0) {
                return false;
            }
        }

        return true;
    }
}
